﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace QLBH.SaleProduct
{
    public partial class FrmFind : Form
    {
        public String TenMHSearch
        {
            get 
            {
                return tbxTenMH.Text;                
            }            
        }
        public FrmFind()
        {
            InitializeComponent();
        }

        private void FrmFind_KeyDown(object sender, KeyEventArgs e)
        {
            if (e.KeyCode==Keys.Enter)
            {
                btnFind_Click(btnFind, null);
            }
            else if (e.KeyCode==Keys.Escape)
            {
                btnClose_Click(btnClose, null);
            }
            else if (e.KeyCode==Keys.F1)
            {
                tbxTenMH.SelectAll();
                tbxTenMH.Focus();
            }
        }

        private void btnFind_Click(object sender, EventArgs e)
        {
            this.DialogResult = DialogResult.OK;
            this.Close();
        }

        private void btnClose_Click(object sender, EventArgs e)
        {
            this.DialogResult = DialogResult.Cancel;
            this.Close();
        }
    }
}
